package com.bw.classfiy.mvvm.adapter;

import android.graphics.Color;
import android.widget.TextView;

import com.bw.classfiy.R;
import com.bw.mvvm.entity.ClassFiyTableEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class ClassFiyTableAdapter extends BaseQuickAdapter<ClassFiyTableEntity.DataBean, BaseViewHolder> {
    public ClassFiyTableAdapter() {
        super(R.layout.item_classfiy_table);
        addChildClickViewIds(R.id.classfiy_table_tv);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, ClassFiyTableEntity.DataBean dataBean) {
        TextView textView = baseViewHolder.getView(R.id.classfiy_table_tv);
        String name = dataBean.getCategory_name();
        baseViewHolder.setText(R.id.classfiy_table_tv,name);
        if (dataBean.isFlag()){
            textView.setBackgroundColor(Color.YELLOW);
        }
    }
}
